package game.entity.mob;

import java.util.Random;

import common.Coordinate;
import common.Log;
import game.gamestate.GameState;
import game.scene.Layer_E;
import game.scene.sceneobject.Rectangle_SO;

public class SolidPrototype extends Mob_Entity {
	public Rectangle_SO Graphics;
	public SolidPrototype(Coordinate location) {
		super("solid_prototype");
		Body.setLocation(location);
	}
	public static Random rnd;
	@Override
	public boolean create(GameState gameState) {
		Graphics = new Rectangle_SO();
		gameState.Scene.getLayer(Layer_E.SPRITE).insert(Graphics);
		Graphics.setBoundry(this.Body.HitBox);
		//Body.Velocity.Y -= 16;
		if(rnd == null) {
			rnd = new Random();
		}
		
		Body.Velocity.Y = -rnd.nextInt(256);
		Body.Velocity.X = rnd.nextInt(64) - 32;
		
		return false;
	}

	@Override
	public boolean think(GameState gameState, int time) {
		Body.Velocity.Y += 1;
		return true;
	}
	
	@Override
	public boolean update(GameState gameState, int time) {
		Graphics.setLocation(this.Body.Location);
		return true;
	}
	
	@Override
	public boolean destroy(GameState gameState) {
		gameState.Scene.getLayer(Layer_E.SPRITE).remove(Graphics);
		return false;
	}


}
